package com.training.admin.dao;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.training.admin.entity.category.TrainingCategory;
/**
 * 
 * @author Rockett
 *
 */
@Dao("hibernate")
public interface TrainingCategoryDao {
	
	/**
	 * 
	 * @param projectId
	 * @return
	 */
	@Query("FROM TrainingCategory WHERE disabled = false and parentId =null")
	public List<TrainingCategory> listAllFirstCategory();

	/**
	 * 
	 * @param projectId
	 * @return
	 */
	@Query("FROM TrainingCategory WHERE disabled = false and parentId =:parentId")
	public List<TrainingCategory> listByFirstCategoryId(@Variable("parentId") Long parentId);

	/**
	 * @return
	 */
	@Query("FROM TrainingCategory WHERE disabled = false and parentId IS NULL")
    public List<TrainingCategory> listFirstCategory();

	/**
	 * @return
	 */
	@Query("FROM TrainingCategory WHERE disabled = false and parentId IS NOT NULL")
    public List<TrainingCategory> listSecondCategory();

	
}
